#ifndef JOLFS_TOOLS_H
#define JOLFS_TOOLS_H

namespace jolfs
{

/**
 * Since size of an enumeration type is "implementation defined" in C++,
 * we need to create a wrapper such as the following.
 */
template <typename E, typename T>
struct Enum
{
  typedef E enum_t;
  typedef T type_t;
  
  Enum() : e_( enum_t() ) {}
  Enum( enum_t e ) : e_( static_cast<type_t>(e) ) {}
  operator enum_t() const { return static_cast<enum_t>(e_); }
  
private:
  type_t e_;
};

} // namespace jolfs

#endif // JOLFS_TOOLS_H
